import {
  Button,
  Input,
  Checkbox,
  Menu,
  Dropdown,
  Modal,
  Descriptions,
  Form,
  Tree,
  Layout,
  Tabs,
  Spin,
  Card,
  Result,
  Progress,
  Table,
  Breadcrumb
} from 'ant-design-vue';
import 'ant-design-vue/dist/reset.css';
import { createApp } from 'vue';
import App from './App.vue';
import '@/assets/iconfont/iconfont.js';
import { createPinia } from 'pinia';

// main.ts
//引入全局样式
// import './styles/main.scss';
const pinia = createPinia();

const init = () => {
  createApp(App)
    .use(Button)
    .use(Input)
    .use(Checkbox)
    .use(Menu)
    .use(Dropdown)
    .use(Modal)
    .use(Descriptions)
    .use(Form)
    .use(Tree)
    .use(Layout)
    .use(Tabs)
    .use(Spin)
    .use(Card)
    .use(Result)
    .use(Progress)
    .use(Table)
    .use(Breadcrumb)
    .use(pinia)
    .mount('#app');
};

if (process.env.NODE_ENV === 'development') {
  // 本地开发需要等待全局变量初始化
  setTimeout(() => {
    init();
  }, 2000);
} else {
  console.log('初始化app');
  init();
}
